import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        while (in.hasNext()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            in.nextLine();
            int max = 0;

            HashSet<String> set = new HashSet<>();
            while(0 != n){
                String s = in.nextLine();
                String[] ss = s.split(" ");
                String id = ss[0];
                String z = ss[1];

                if(!set.contains(id)){
                    set.add(id);
                }else{
                    set.remove(id);
                }
                max = Math.max(max,set.size());
                n -= 1;
            }

            System.out.println(max);
        }
    }
}